3 * Base class for all changes lists.
5 * The class is used for formatting recent changes, related changes and watchlist.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * http://www.gnu.org/copyleft/gpl.html
24 use MediaWiki\Linker\LinkRenderer
;
25 use MediaWiki\MediaWikiServices
;
26 use MediaWiki\Storage\RevisionRecord
;
27 use Wikimedia\Rdbms\IResultWrapper
;
29 class ChangesList
extends ContextSource
{
30 const CSS_CLASS_PREFIX
= 'mw-changeslist-';
37 protected $watchlist = false;
41 protected $rcCacheIndex;
42 protected $rclistOpen;
43 protected $rcMoveIndex;
46 protected $changeLinePrefixer;
48 /** @var MapCacheLRU */
49 protected $watchMsgCache;
54 protected $linkRenderer;
59 protected $filterGroups;
62 * @param Skin|IContextSource $obj
63 * @param array $filterGroups Array of ChangesListFilterGroup objects (currently optional)
65 public function __construct( $obj, array $filterGroups = [] ) {
66 if ( $obj instanceof IContextSource
) {
67 $this->setContext( $obj );
68 $this->skin
= $obj->getSkin();
70 $this->setContext( $obj->getContext() );
73 $this->preCacheMessages();
74 $this->watchMsgCache
= new MapCacheLRU( 50 );
75 $this->linkRenderer
= MediaWikiServices
::getInstance()->getLinkRenderer();
76 $this->filterGroups
= $filterGroups;
80 * Fetch an appropriate changes list class for the specified context
81 * Some users might want to use an enhanced list format, for instance
83 * @param IContextSource $context
84 * @param array $groups Array of ChangesListFilterGroup objects (currently optional)
87 public static function newFromContext( IContextSource
$context, array $groups = [] ) {
88 $user = $context->getUser();
89 $sk = $context->getSkin();
91 if ( Hooks
::run( 'FetchChangesList', [ $user, &$sk, &$list, $groups ] ) ) {
92 $new = $context->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
95 new EnhancedChangesList( $context, $groups ) :
96 new OldChangesList( $context, $groups );
107 * @param RecentChange &$rc Passed by reference
108 * @param bool $watched (default false)
109 * @param int|null $linenumber (default null)
111 * @return string|bool
113 public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
114 throw new RuntimeException( 'recentChangesLine should be implemented' );
118 * Get the container for highlights that are used in the new StructuredFilters
121 * @return string HTML structure of the highlight container div
123 protected function getHighlightsContainerDiv() {
124 $highlightColorDivs = '';
125 foreach ( [ 'none', 'c1', 'c2', 'c3', 'c4', 'c5' ] as $color ) {
126 $highlightColorDivs .= Html
::rawElement(
129 'class' => 'mw-rcfilters-ui-highlights-color-' . $color,
130 'data-color' => $color
135 return Html
::rawElement(
137 [ 'class' => 'mw-rcfilters-ui-highlights' ],
143 * Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag
146 public function setWatchlistDivs( $value = true ) {
147 $this->watchlist
= $value;
151 * @return bool True when setWatchlistDivs has been called
154 public function isWatchlist() {
155 return (bool)$this->watchlist
;
159 * As we use the same small set of messages in various methods and that
160 * they are called often, we call them once and save them in $this->message
162 private function preCacheMessages() {
163 if ( !isset( $this->message
) ) {
165 'cur', 'diff', 'hist', 'enhancedrc-history', 'last', 'blocklink', 'history',
166 'semicolon-separator', 'pipe-separator' ] as $msg
168 $this->message
[$msg] = $this->msg( $msg )->escaped();
174 * Returns the appropriate flags for new page, minor change and patrolling
175 * @param array $flags Associative array of 'flag' => Bool
176 * @param string $nothing To use for empty space
179 public function recentChangesFlags( $flags, $nothing = "\u{00A0}" ) {
181 foreach ( array_keys( $this->getConfig()->get( 'RecentChangesFlags' ) ) as $flag ) {
182 $f .= isset( $flags[$flag] ) && $flags[$flag]
183 ? self
::flag( $flag, $this->getContext() )
191 * Get an array of default HTML class attributes for the change.
193 * @param RecentChange|RCCacheEntry $rc
194 * @param string|bool $watched Optionally timestamp for adding watched class
196 * @return string[] List of CSS class names
198 protected function getHTMLClasses( $rc, $watched ) {
199 $classes = [ self
::CSS_CLASS_PREFIX
. 'line' ];
200 $logType = $rc->mAttribs
['rc_log_type'];
203 $classes[] = self
::CSS_CLASS_PREFIX
. 'log';
204 $classes[] = Sanitizer
::escapeClass( self
::CSS_CLASS_PREFIX
. 'log-' . $logType );
206 $classes[] = self
::CSS_CLASS_PREFIX
. 'edit';
207 $classes[] = Sanitizer
::escapeClass( self
::CSS_CLASS_PREFIX
. 'ns' .
208 $rc->mAttribs
['rc_namespace'] . '-' . $rc->mAttribs
['rc_title'] );
211 // Indicate watched status on the line to allow for more
212 // comprehensive styling.
213 $classes[] = $watched && $rc->mAttribs
['rc_timestamp'] >= $watched
214 ? self
::CSS_CLASS_PREFIX
. 'line-watched'
215 : self
::CSS_CLASS_PREFIX
. 'line-not-watched';
217 $classes = array_merge( $classes, $this->getHTMLClassesForFilters( $rc ) );
223 * Get an array of CSS classes attributed to filters for this row. Used for highlighting
226 * @param RecentChange $rc
227 * @return array Array of CSS classes
229 protected function getHTMLClassesForFilters( $rc ) {
232 $classes[] = Sanitizer
::escapeClass( self
::CSS_CLASS_PREFIX
. 'ns-' .
233 $rc->mAttribs
['rc_namespace'] );
235 if ( $this->filterGroups
!== null ) {
236 foreach ( $this->filterGroups
as $filterGroup ) {
237 foreach ( $filterGroup->getFilters() as $filter ) {
238 $filter->applyCssClassIfNeeded( $this, $rc, $classes );
247 * Make an "<abbr>" element for a given change flag. The flag indicating a new page, minor edit,
248 * bot edit, or unpatrolled edit. In English it typically contains "N", "m", "b", or "!".
250 * @param string $flag One key of $wgRecentChangesFlags
251 * @param IContextSource|null $context
252 * @return string HTML
254 public static function flag( $flag, IContextSource
$context = null ) {
255 static $map = [ 'minoredit' => 'minor', 'botedit' => 'bot' ];
256 static $flagInfos = null;
258 if ( is_null( $flagInfos ) ) {
259 global $wgRecentChangesFlags;
261 foreach ( $wgRecentChangesFlags as $key => $value ) {
262 $flagInfos[$key]['letter'] = $value['letter'];
263 $flagInfos[$key]['title'] = $value['title'];
264 // Allow customized class name, fall back to flag name
265 $flagInfos[$key]['class'] = $value['class'] ??
$key;
269 $context = $context ?
: RequestContext
::getMain();
271 // Inconsistent naming, kepted for b/c
272 if ( isset( $map[$flag] ) ) {
276 $info = $flagInfos[$flag];
277 return Html
::element( 'abbr', [
278 'class' => $info['class'],
279 'title' => wfMessage( $info['title'] )->setContext( $context )->text(),
280 ], wfMessage( $info['letter'] )->setContext( $context )->text() );
284 * Returns text for the start of the tabular part of RC
287 public function beginRecentChangesList() {
288 $this->rc_cache
= [];
289 $this->rcMoveIndex
= 0;
290 $this->rcCacheIndex
= 0;
291 $this->lastdate
= '';
292 $this->rclistOpen
= false;
293 $this->getOutput()->addModuleStyles( [
294 'mediawiki.interface.helpers.styles',
295 'mediawiki.special.changeslist'
298 return '<div class="mw-changeslist">';
302 * @param IResultWrapper|array $rows
304 public function initChangesListRows( $rows ) {
305 Hooks
::run( 'ChangesListInitRows', [ $this, $rows ] );
309 * Show formatted char difference
311 * Needs the css module 'mediawiki.special.changeslist' to style output
313 * @param int $old Number of bytes
314 * @param int $new Number of bytes
315 * @param IContextSource|null $context
318 public static function showCharacterDifference( $old, $new, IContextSource
$context = null ) {
320 $context = RequestContext
::getMain();
325 $szdiff = $new - $old;
327 $lang = $context->getLanguage();
328 $config = $context->getConfig();
329 $code = $lang->getCode();
330 static $fastCharDiff = [];
331 if ( !isset( $fastCharDiff[$code] ) ) {
332 $fastCharDiff[$code] = $config->get( 'MiserMode' )
333 ||
$context->msg( 'rc-change-size' )->plain() === '$1';
336 $formattedSize = $lang->formatNum( $szdiff );
338 if ( !$fastCharDiff[$code] ) {
339 $formattedSize = $context->msg( 'rc-change-size', $formattedSize )->text();
342 if ( abs( $szdiff ) > abs( $config->get( 'RCChangedSizeThreshold' ) ) ) {
348 if ( $szdiff === 0 ) {
349 $formattedSizeClass = 'mw-plusminus-null';
350 } elseif ( $szdiff > 0 ) {
351 $formattedSize = '+' . $formattedSize;
352 $formattedSizeClass = 'mw-plusminus-pos';
354 $formattedSizeClass = 'mw-plusminus-neg';
356 $formattedSizeClass .= ' mw-diff-bytes';
358 $formattedTotalSize = $context->msg( 'rc-change-size-new' )->numParams( $new )->text();
360 return Html
::element( $tag,
361 [ 'dir' => 'ltr', 'class' => $formattedSizeClass, 'title' => $formattedTotalSize ],
362 $formattedSize ) . $lang->getDirMark();
366 * Format the character difference of one or several changes.
368 * @param RecentChange $old
369 * @param RecentChange|null $new Last change to use, if not provided, $old will be used
370 * @return string HTML fragment
372 public function formatCharacterDifference( RecentChange
$old, RecentChange
$new = null ) {
373 $oldlen = $old->mAttribs
['rc_old_len'];
376 $newlen = $new->mAttribs
['rc_new_len'];
378 $newlen = $old->mAttribs
['rc_new_len'];
381 if ( $oldlen === null ||
$newlen === null ) {
385 return self
::showCharacterDifference( $oldlen, $newlen, $this->getContext() );
389 * Returns text for the end of RC
392 public function endRecentChangesList() {
393 $out = $this->rclistOpen ?
"</ul>\n" : '';
400 * Render the date and time of a revision in the current user language
401 * based on whether the user is able to view this information or not.
402 * @param Revision $rev
404 * @param Language $lang
405 * @param Title|null $title (optional) where Title does not match
406 * the Title associated with the Revision
407 * @internal For usage by Pager classes only (e.g. HistoryPager and ContribsPager).
408 * @return string HTML
410 public static function revDateLink( Revision
$rev, User
$user, Language
$lang, $title = null ) {
411 $ts = $rev->getTimestamp();
412 $date = $lang->userTimeAndDate( $ts, $user );
413 if ( $rev->userCan( RevisionRecord
::DELETED_TEXT
, $user ) ) {
414 $link = MediaWikiServices
::getInstance()->getLinkRenderer()->makeKnownLink(
415 $title ??
$rev->getTitle(),
417 [ 'class' => 'mw-changeslist-date' ],
418 [ 'oldid' => $rev->getId() ]
421 $link = htmlspecialchars( $date );
423 if ( $rev->isDeleted( RevisionRecord
::DELETED_TEXT
) ) {
424 $link = "<span class=\"history-deleted mw-changeslist-date\">$link</span>";
430 * @param string &$s HTML to update
431 * @param mixed $rc_timestamp
433 public function insertDateHeader( &$s, $rc_timestamp ) {
434 # Make date header if necessary
435 $date = $this->getLanguage()->userDate( $rc_timestamp, $this->getUser() );
436 if ( $date != $this->lastdate
) {
437 if ( $this->lastdate
!= '' ) {
440 $s .= Xml
::element( 'h4', null, $date ) . "\n<ul class=\"special\">";
441 $this->lastdate
= $date;
442 $this->rclistOpen
= true;
447 * @param string &$s HTML to update
448 * @param Title $title
449 * @param string $logtype
451 public function insertLog( &$s, $title, $logtype ) {
452 $page = new LogPage( $logtype );
453 $logname = $page->getName()->setContext( $this->getContext() )->text();
454 $s .= $this->msg( 'parentheses' )->rawParams(
455 $this->linkRenderer
->makeKnownLink( $title, $logname )
460 * @param string &$s HTML to update
461 * @param RecentChange &$rc
462 * @param bool|null $unpatrolled Unused variable, since 1.27.
464 public function insertDiffHist( &$s, &$rc, $unpatrolled = null ) {
467 $rc->mAttribs
['rc_type'] == RC_NEW ||
468 $rc->mAttribs
['rc_type'] == RC_LOG ||
469 $rc->mAttribs
['rc_type'] == RC_CATEGORIZE
471 $diffLink = $this->message
['diff'];
472 } elseif ( !self
::userCan( $rc, RevisionRecord
::DELETED_TEXT
, $this->getUser() ) ) {
473 $diffLink = $this->message
['diff'];
476 'curid' => $rc->mAttribs
['rc_cur_id'],
477 'diff' => $rc->mAttribs
['rc_this_oldid'],
478 'oldid' => $rc->mAttribs
['rc_last_oldid']
481 $diffLink = $this->linkRenderer
->makeKnownLink(
483 new HtmlArmor( $this->message
['diff'] ),
484 [ 'class' => 'mw-changeslist-diff' ],
488 if ( $rc->mAttribs
['rc_type'] == RC_CATEGORIZE
) {
489 $histLink = $this->message
['hist'];
491 $histLink = $this->linkRenderer
->makeKnownLink(
493 new HtmlArmor( $this->message
['hist'] ),
494 [ 'class' => 'mw-changeslist-history' ],
496 'curid' => $rc->mAttribs
['rc_cur_id'],
497 'action' => 'history'
502 $s .= Html
::rawElement( 'div', [ 'class' => 'mw-changeslist-links' ],
503 Html
::rawElement( 'span', [], $diffLink ) .
504 Html
::rawElement( 'span', [], $histLink )
506 ' <span class="mw-changeslist-separator"></span> ';
510 * @param RecentChange &$rc
511 * @param bool $unpatrolled
512 * @param bool $watched
513 * @return string HTML
516 public function getArticleLink( &$rc, $unpatrolled, $watched ) {
518 if ( $rc->getTitle()->isRedirect() ) {
519 $params = [ 'redirect' => 'no' ];
522 $articlelink = $this->linkRenderer
->makeLink(
525 [ 'class' => 'mw-changeslist-title' ],
528 if ( $this->isDeleted( $rc, RevisionRecord
::DELETED_TEXT
) ) {
529 $articlelink = '<span class="history-deleted">' . $articlelink . '</span>';
531 # To allow for boldening pages watched by this user
532 $articlelink = "<span class=\"mw-title\">{$articlelink}</span>";
534 $articlelink .= $this->getLanguage()->getDirMark();
536 # TODO: Deprecate the $s argument, it seems happily unused.
538 # Avoid PHP 7.1 warning from passing $this by reference
539 $changesList = $this;
540 Hooks
::run( 'ChangesListInsertArticleLink',
541 [ &$changesList, &$articlelink, &$s, &$rc, $unpatrolled, $watched ] );
543 return "{$s} {$articlelink}";
547 * Get the timestamp from $rc formatted with current user's settings
550 * @param RecentChange $rc
551 * @deprecated use revDateLink instead.
552 * @return string HTML fragment
554 public function getTimestamp( $rc ) {
555 // @todo FIXME: Hard coded ". .". Is there a message for this? Should there be?
556 return $this->message
['semicolon-separator'] . '<span class="mw-changeslist-date">' .
557 htmlspecialchars( $this->getLanguage()->userTime(
558 $rc->mAttribs
['rc_timestamp'],
560 ) ) . '</span> <span class="mw-changeslist-separator"></span> ';
564 * Insert time timestamp string from $rc into $s
566 * @param string &$s HTML to update
567 * @param RecentChange $rc
569 public function insertTimestamp( &$s, $rc ) {
570 $s .= $this->getTimestamp( $rc );
574 * Insert links to user page, user talk page and eventually a blocking link
576 * @param string &$s HTML to update
577 * @param RecentChange &$rc
579 public function insertUserRelatedLinks( &$s, &$rc ) {
580 if ( $this->isDeleted( $rc, RevisionRecord
::DELETED_USER
) ) {
581 $s .= ' <span class="history-deleted">' .
582 $this->msg( 'rev-deleted-user' )->escaped() . '</span>';
584 $s .= $this->getLanguage()->getDirMark() . Linker
::userLink( $rc->mAttribs
['rc_user'],
585 $rc->mAttribs
['rc_user_text'] );
586 $s .= Linker
::userToolLinks(
587 $rc->mAttribs
['rc_user'], $rc->mAttribs
['rc_user_text'],
589 // The text content of tools is not wrapped with parenthesises or "piped".
590 // This will be handled in CSS (T205581).
597 * Insert a formatted action
599 * @param RecentChange $rc
602 public function insertLogEntry( $rc ) {
603 $formatter = LogFormatter
::newFromRow( $rc->mAttribs
);
604 $formatter->setContext( $this->getContext() );
605 $formatter->setShowUserToolLinks( true );
606 $mark = $this->getLanguage()->getDirMark();
608 return $formatter->getActionText() . " $mark" . $formatter->getComment();
612 * Insert a formatted comment
613 * @param RecentChange $rc
616 public function insertComment( $rc ) {
617 if ( $this->isDeleted( $rc, RevisionRecord
::DELETED_COMMENT
) ) {
618 return ' <span class="history-deleted">' .
619 $this->msg( 'rev-deleted-comment' )->escaped() . '</span>';
621 return Linker
::commentBlock( $rc->mAttribs
['rc_comment'], $rc->getTitle(),
622 // Whether section links should refer to local page (using default false)
624 // wikid to generate links for (using default null) */
626 // whether parentheses should be rendered as part of the message
632 * Returns the string which indicates the number of watching users
633 * @param int $count Number of user watching a page
636 protected function numberofWatchingusers( $count ) {
641 return $this->watchMsgCache
->getWithSetCallback(
642 "watching-users-msg:$count",
643 function () use ( $count ) {
644 return $this->msg( 'number-of-watching-users-for-recent-changes' )
645 ->numParams( $count )->escaped();
651 * Determine if said field of a revision is hidden
652 * @param RCCacheEntry|RecentChange $rc
653 * @param int $field One of DELETED_* bitfield constants
656 public static function isDeleted( $rc, $field ) {
657 return ( $rc->mAttribs
['rc_deleted'] & $field ) == $field;
661 * Determine if the current user is allowed to view a particular
662 * field of this revision, if it's marked as deleted.
663 * @param RCCacheEntry|RecentChange $rc
665 * @param User|null $user User object to check, or null to use $wgUser
668 public static function userCan( $rc, $field, User
$user = null ) {
669 if ( $rc->mAttribs
['rc_type'] == RC_LOG
) {
670 return LogEventsList
::userCanBitfield( $rc->mAttribs
['rc_deleted'], $field, $user );
672 return Revision
::userCanBitfield( $rc->mAttribs
['rc_deleted'], $field, $user );
677 * @param string $link
678 * @param bool $watched
681 protected function maybeWatchedLink( $link, $watched = false ) {
683 return '<strong class="mw-watched">' . $link . '</strong>';
685 return '<span class="mw-rc-unwatched">' . $link . '</span>';
690 * Insert a rollback link
693 * @param RecentChange &$rc
695 public function insertRollback( &$s, &$rc ) {
696 if ( $rc->mAttribs
['rc_type'] == RC_EDIT
697 && $rc->mAttribs
['rc_this_oldid']
698 && $rc->mAttribs
['rc_cur_id']
699 && $rc->getAttribute( 'page_latest' ) == $rc->mAttribs
['rc_this_oldid']
701 $title = $rc->getTitle();
702 /** Check for rollback permissions, disallow special pages, and only
703 * show a link on the top-most revision */
704 if ( $title->quickUserCan( 'rollback', $this->getUser() ) ) {
705 $rev = new Revision( [
707 'id' => $rc->mAttribs
['rc_this_oldid'],
708 'user' => $rc->mAttribs
['rc_user'],
709 'user_text' => $rc->mAttribs
['rc_user_text'],
710 'actor' => $rc->mAttribs
['rc_actor'] ??
null,
711 'deleted' => $rc->mAttribs
['rc_deleted']
713 $s .= ' ' . Linker
::generateRollback( $rev, $this->getContext(),
720 * @param RecentChange $rc
724 public function getRollback( RecentChange
$rc ) {
726 $this->insertRollback( $s, $rc );
732 * @param RecentChange &$rc
733 * @param array &$classes
735 public function insertTags( &$s, &$rc, &$classes ) {
736 if ( empty( $rc->mAttribs
['ts_tags'] ) ) {
740 list( $tagSummary, $newClasses ) = ChangeTags
::formatSummaryRow(
741 $rc->mAttribs
['ts_tags'],
745 $classes = array_merge( $classes, $newClasses );
746 $s .= ' ' . $tagSummary;
750 * @param RecentChange $rc
751 * @param array &$classes
755 public function getTags( RecentChange
$rc, array &$classes ) {
757 $this->insertTags( $s, $rc, $classes );
761 public function insertExtra( &$s, &$rc, &$classes ) {
762 // Empty, used for subclasses to add anything special.
765 protected function showAsUnpatrolled( RecentChange
$rc ) {
766 return self
::isUnpatrolled( $rc, $this->getUser() );
770 * @param object|RecentChange $rc Database row from recentchanges or a RecentChange object
774 public static function isUnpatrolled( $rc, User
$user ) {
775 if ( $rc instanceof RecentChange
) {
776 $isPatrolled = $rc->mAttribs
['rc_patrolled'];
777 $rcType = $rc->mAttribs
['rc_type'];
778 $rcLogType = $rc->mAttribs
['rc_log_type'];
780 $isPatrolled = $rc->rc_patrolled
;
781 $rcType = $rc->rc_type
;
782 $rcLogType = $rc->rc_log_type
;
785 if ( !$isPatrolled ) {
786 if ( $user->useRCPatrol() ) {
789 if ( $user->useNPPatrol() && $rcType == RC_NEW
) {
792 if ( $user->useFilePatrol() && $rcLogType == 'upload' ) {
801 * Determines whether a revision is linked to this change; this may not be the case
802 * when the categorization wasn't done by an edit but a conditional parser function
806 * @param RecentChange|RCCacheEntry $rcObj
809 protected function isCategorizationWithoutRevision( $rcObj ) {
810 return intval( $rcObj->getAttribute( 'rc_type' ) ) === RC_CATEGORIZE
811 && intval( $rcObj->getAttribute( 'rc_this_oldid' ) ) === 0;
815 * Get recommended data attributes for a change line.
816 * @param RecentChange $rc
817 * @return string[] attribute name => value
819 protected function getDataAttributes( RecentChange
$rc ) {
822 $type = $rc->getAttribute( 'rc_source' );
824 case RecentChange
::SRC_EDIT
:
825 case RecentChange
::SRC_NEW
:
826 $attrs['data-mw-revid'] = $rc->mAttribs
['rc_this_oldid'];
828 case RecentChange
::SRC_LOG
:
829 $attrs['data-mw-logid'] = $rc->mAttribs
['rc_logid'];
830 $attrs['data-mw-logaction'] =
831 $rc->mAttribs
['rc_log_type'] . '/' . $rc->mAttribs
['rc_log_action'];
835 $attrs[ 'data-mw-ts' ] = $rc->getAttribute( 'rc_timestamp' );
841 * Sets the callable that generates a change line prefix added to the beginning of each line.
843 * @param callable $prefixer Callable to run that generates the change line prefix.
844 * Takes three parameters: a RecentChange object, a ChangesList object,
845 * and whether the current entry is a grouped entry.
847 public function setChangeLinePrefixer( callable
$prefixer ) {
848 $this->changeLinePrefixer
= $prefixer;